/*
 * URT.h
 *
 *  Created on: May 21, 2011
 *      Author: ulas
 */

#ifndef URT_H_
#define URT_H_

#include "CLProtocol.h"
#include "vCLURT.h"

typedef struct
{
	U8 nodeId;
	U8 ch;
	U8 eT; //in msec
	U8 dT; //in msec
}URT_COMMUNICATION_REQUEST_TYPE;

typedef struct
{
	U8 totalNumberOfRequests;
	URT_COMMUNICATION_REQUEST_TYPE comRequests[URT_MAX_COM_REQUESTS_COUNT];
}URT_MESSAGE_PARAMETER_TYPE;

class URT: public CLProtocol {
private:
	vCLURT* vCL;

public:
	URT(U8 nodeId);
	URT_COMMUNICATION_REQUEST_PQ_TYPE* getAvailableRequest();

	STATUS gUpdate(const U8* msg, const U16 messageLength);
	STATUS gRealTime(SLOT_TYPE* RTCL);
	STATUS gMySlot(myCL_TYPE* myCL);

	U16 prepareCLHeader(U8* msg, void* parPtr);
	U8 getCLHeaderLength(U8* msg);
	void updateCountForDART();


	virtual ~URT();
};

#endif /* URT_H_ */
